

export function useCouponType() {
  const CouponType = [
    {
      label: "满减券",
      value: 1,
      desc: "立减XX元"
    },
    {
      label: "折扣券",
      value: 2,
      desc: "按比例打折"
    },
    {
      label: "兑换券",
      value: 3,
      desc: "兑换指定商品"
    }
  ]
  
  const getCouponTypeName = (value: number | undefined) => {
    if (!value) {
      return ""
    }
    return CouponType.find(item => item.value === value)?.label ?? value
  }

  return {
    CouponType,
    getCouponTypeName,
  }
}